package me.helllp.dake.iam.core.service;

import me.helllp.dake.common.exception.DakeAuthException;
import me.helllp.dake.common.exception.DakeEncryptException;
import me.helllp.dake.common.exception.DakeException;
import me.helllp.dake.core.bean.DakeAuthAccount;
import me.helllp.dake.iam.core.dto.AuthDto;
import me.helllp.dake.iam.core.dto.LoginDto;
import me.helllp.dake.iam.core.vo.LoginVo;

import java.io.UnsupportedEncodingException;

public interface IAuthService {
    LoginVo login(LoginDto loginDto) throws  DakeException;

    DakeAuthAccount verifyToken(String token) throws DakeAuthException;

    Boolean logout(String token) throws DakeAuthException;

    String genVerifyCode(Long tenantId, String account);

    Boolean auth(DakeAuthAccount account, AuthDto authDto);

    /**
     * 更新应用的权限缓存信息 </br>
     * 缓存设计 {tenantId}:{applicationId}:{roleName} = set(method_url)，指定租户、应用和角色，缓存当前角色的URL资源信息
     *
     * @param tenantId 租户ID
     * @param applicationId 应用ID
     * @return
     */
    Boolean putAuthCache(Long tenantId, Long applicationId);
}
